//
//  Contact.m
//  17-HomeWork(通讯录)
//
//  Created by ParkourH on 16/8/6.
//  Copyright © 2016年 ParkourH. All rights reserved.
//

#import "Contact.h"

@implementation Contact

- (void)setValue:(id)value forUndefinedKey:(NSString *)key {

}

// 取值
- (instancetype)initWithCoder:(NSCoder *)aDecoder {

    self = [super init];
    if (self) {
        
//        _dictionary = [aDecoder decodeObjectForKey:@"contactDic"];
        _name = [aDecoder decodeObjectForKey:@"name"];
        _age = [[aDecoder decodeObjectForKey:@"age"] integerValue];
        _gender = [aDecoder decodeObjectForKey:@"gender"];
        _phoneNumber = (long)[aDecoder decodeObjectForKey:@"phoneNumber"];
        _phoneNumber = [[aDecoder decodeObjectForKey:@"phoneNumber"] integerValue];
        _image = [aDecoder decodeObjectForKey:@"image"];
    }
    return self;
}

// 赋值cccc
- (void)encodeWithCoder:(NSCoder *)aCoder {

//    [aCoder encodeObject:_dictionary forKey:@"contactDic"];
    [aCoder encodeObject:_name forKey:@"name"];
    [aCoder encodeDouble:_age forKey:@"age"];
    [aCoder encodeObject:_gender forKey:@"gender"];
    [aCoder encodeObject:[NSString stringWithFormat:@"%ld", _phoneNumber] forKey:@"phoneNumber"];
    [aCoder encodeObject:_image forKey:@"image"];
    
    
}



@end
